<!-- 我的爱车 页面-->
<include file='Common:head'/>
<form id="upForm">
<div class="box">
<div class="add_car_view">
	<div class="">次卡(五座车):&nbsp;<input type="text" name="day" placeholder="{$info.day_card}" pattern="[0-9]*" style="width:25%;"/>元</div>
	<div class="">次卡(七座车):&nbsp;<input type="text" name="day_seven" placeholder="{$info.day_seven_card}" pattern="[0-9]*" style="width:25%;"/>元</div>
	<div class="">次卡(&nbsp;其&nbsp;&nbsp;他&nbsp;):&nbsp;<input type="text" name="day_other" placeholder="{$info.day_other_card}" pattern="[0-9]*" style="width:25%;"/>元</div>
	
	<div class="">周卡(五座车);:&nbsp;<input type="text" name="week" placeholder="{$info.week_card}" pattern="[0-9]*" style="width:25%;"/>元</div>
	<div class="">周卡(七座车):&nbsp;<input type="text" name="week_seven" placeholder="{$info.week_seven_card}" pattern="[0-9]*" style="width:25%;"/>元</div>
	<div class="">周卡(&nbsp;其&nbsp;&nbsp;他&nbsp;):&nbsp;<input type="text" name="week_other" placeholder="{$info.week_other_card}" pattern="[0-9]*" style="width:25%;"/>元</div>
	
	<div class="">月卡(五座车):&nbsp;<input type="text" name="month" placeholder="{$info.month_card}" pattern="[0-9]*" style="width:25%;"/>元</div>
	<div class="">月卡(七座车):&nbsp;<input type="text" name="month_seven" placeholder="{$info.month_seven_card}" pattern="[0-9]*" style="width:25%;"/>元</div>
	<div class="">月卡(&nbsp;其&nbsp;&nbsp;他&nbsp;):&nbsp;<input type="text" name="month_other" placeholder="{$info.month_other_card}" pattern="[0-9]*" style="width:25%;"/>元</div>
	
	<div class="">年卡(五座车):&nbsp;<input type="text" name="year" placeholder="{$info.year_card}" pattern="[0-9]*" style="width:25%;"/>元</div>
	<div class="">年卡(七座车):&nbsp;<input type="text" name="year_seven" placeholder="{$info.year_seven_card}" pattern="[0-9]*" style="width:25%;"/>元</div>
	<div class="">年卡(&nbsp;其&nbsp;&nbsp;他&nbsp;):&nbsp;<input type="text" name="year_other" placeholder="{$info.year_other_card}" pattern="[0-9]*" style="width:25%;"/>元</div>
	
	<div class="" style="color:#FF0000;font-size:2.8rem;">*當不填寫的時候，客戶端將不會顯示該價格為空的選項！</div>
	<div class="button"><input type="button" value="提交"/></div>
</div>
</div>
</form>
<script type="text/javascript">

//申明表單內容變量
var savePostData = {} ;

$(document).ready(function(){
	$('title').html('設置洗車卡價格');
	$('.header .title').html('設置洗車卡價格');
	$('.header .left').html('<img src="__PRIVATE__/images/left.png" style="width:55%"/>');
	$('.header .right').html('');
	$('.header .left').click(function(){
		//返回-我的爱车
		window.location.href = "{:U(MODULE_NAME.'/'.CONTROLLER_NAME.'/set_index')}";
	});
});

// 添加操作
$('.add_car_view .button').click(function(){
	if($('input[name=day]').val()==''&&$('input[name=week]').val()==''&&$('input[name=month]').val()==''&&$('input[name=year]').val()==''){
		layer.open({
			style:'font-size:3rem;',
			content:'至少填寫一項',
			time:2,
		});
		return false;
	}
	
	var formData = new FormData($( "#upForm" )[0]);   
    $.ajax({    
         url: "{:U(MODULE_NAME.'/'.CONTROLLER_NAME.'/add_card_price')}" ,  /*这是处理文件上传的servlet*/  
         type: 'POST',    
         data : formData,    
         async: false,    
         cache: false,    
         contentType: false,    
         processData: false,    
         success: function (returndata) {    
        	 if(returndata.status==1){
        		 layer.open({
      				style:'font-size:3rem;',
      				content:returndata.info,
      				time:2,
      				end:function(){
     					window.location.href = returndata.url;
     		 		}
      			});
        	 }else{
        		 layer.open({
       				style:'font-size:3rem;',
       				content:returndata.info,
       				time:2,
       			});
        	 }
         }
    });    
});


</script>
<include file='Common:footer_3'/>
